package com.usian.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RestController
public class SessionController {


    @RequestMapping("/set")
    public String set(String key, String value, HttpSession httpSession){
        httpSession.setAttribute(key,value);
        return "setSucc";
    }

    @RequestMapping("/get")
    public String get(String key,HttpSession httpSession){
        String valueStr = (String)httpSession.getAttribute(key);
        return valueStr;
    }
}
